﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Biz.UserManagement;
using Ext.Net;

namespace Web
{
    public partial class IDManagement : PageHelper
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                gpUsr.Store.Primary.DataSource = IDAdmin.ListAll();
                gpUsr.Store.Primary.DataBind();
            }
        }

        protected void Add_Click(object sender, DirectEventArgs e)
        {
            gpUsr.Store.Primary.AddRecord(IDAdmin.New());
        }

        protected void Save_Click(object sender, DirectEventArgs e)
        {
            if (string.IsNullOrEmpty(rsm.SelectedRecordID))
            {
                X.Msg.Alert("提示", "请选择一条记录").Show();
                return;
            }
            Employee em = new Employee(int.Parse(rsm.SelectedRecordID));
            em.Save();
        }
    }
}